<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
'HienSX
sort=Request("sort")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel=stylesheet href="..\CSS\styleform.css" type="text/css">
<title>QUYẾT ĐỊNH</title>
<script language="javascript" src="..\JS\toolBarButton.js"></script>
<!--#include file="..\CheckSession.inc"-->
<!--#include file="..\jvFunction.inc"-->
</head>
<body style="font-family: Times New Roman" topmargin=0 leftmargin=0 bgcolor=#BDD5D0>
<form method="post" name="Noidung">
<!-- HienSX -->
<Input TYPE="hidden" name="Sort" value="<%=sort%>">
<input name="TxtID" size="50" type="hidden">
<table cellspacing=0 cellpadding=0 border=0 style="table-layout: fixed; height: 1px">
	<tr><td style="width: 100%; height: 1px; background-color: white">&nbsp;</td></tr>
</table>
<table id=toolbar cellspacing="0" >
	<tr>
		<td>
			<table cellspacing="0">
				<tr>
					<td class="toolBarButton" id=btnSearch onaction="javascript:OK()"><img src="..\images\icons\button_search.gif" align="absmiddle" width="16" height="20"> <b>Tìm kiếm</b></td>
					<td class="toolBarButton" id=btnCancel onaction="javascript:window.close()"><img src="..\images\icons\button_cancel.gif" align="absmiddle" width="16" height="20"><b>Bỏ qua</b></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<table cellspacing=0 cellpadding=0 border=0 style="table-layout: fixed; height: 1px">
	<tr><td style="width: 100%; height: 1px; background-color: 808080">&nbsp;</td></tr>
</table>
</table>
<table class="controlbox" width="100%">	
<tr> 
<td valign="top">
<FIELDSET> 
<LEGEND><b>Thông tin tìm kiếm :</b></LEGEND> 
<table width="100%" bgColor="#BDD5D0" border="0" cellpadding="0" cellSpacing="0" style="FONT-SIZE: 9pt;Font-family:Arial" >
	  <tr>      
		<td width="15%" >&nbsp;Số QĐ</td>
		<td width="15%"><input name=TxtSoden style="font-family:times new roman;width:100%;" size="20" LANGUAGE=javascript onkeyup="return TxtSoden_onkeyup(this.value)"></td>
	<td width="15%" align=center>===></td>
	<td width="15%">
    <input name=TxtDenso style="font-family:times new roman;width:100%;" size="20"></td>
        <td width="15%" align=center>Năm</td>
	<td width="15%">
    <input name=TxtNam maxlength=4 style="font-family:times new roman;width:100%;" size="20" value=<%=year(Date())%>></td>
	<td width="10%" >&nbsp;</td>
      </tr>
      <tr>
        <td width="15%" >&nbsp;Ngày ký QĐ</td>
        <td width="15%">
        <input name=TxtTungay disabled style="font-family:times new roman;width:100%;background-color:#C0C0C0" size="20" maxlength=10 LANGUAGE=javascript onkeyup="return TxtTungay_onkeyup(this.value)"></td>
        <td width="15%" align=center>===></td>                
        <td width="15%">
        <input name=TxtDenngay disabled style="font-family:times new roman;width:100%;background-color:#C0C0C0" size="20" maxlength=10 LANGUAGE=javascript onkeyup="return TxtDenngay_onkeyup(this.value)"></td>
        <td width="15%" align=center>
        <INPUT TYPE="checkbox" NAME="CHK"  onclick="return Cmd(true)" value="ON"></td>        
        <td width="25%" colspan=2>
    			<label for=C1 >Tìm chính xác</label>
			<INPUT TYPE="checkbox" NAME="chkTimCX" value="ON"  id=C1>		
   	   </td>     
      </tr>
      <tr>
        <td width="15%" >&nbsp;Số ký hiệu</td>
        <td width="85%" colspan=6>
        <input name=TxtSKH style="font-family:times new roman;width:100%" size="20"></td>
      </tr>

      <tr>
        <td width="15%" >&nbsp;Trích yếu</td>
        <td width="85%" colspan=6>
        <input name=TxtTrichyeu style="font-family:times new roman;width:100%" size="20"></td>
      </tr>
      <tr>
        <td width="15%" >&nbsp;Tóm tắt ND</td>
        <td width="85%" colspan=6>
        <input name=TxtND style="font-family:times new roman;width:100%" size="20"></td>
      </tr>
      <tr>
        <td width="15%" >&nbsp;Tên loại VB</td>
        <td width="85%" colspan=6>
        	<Select name=ComboLoaiVB style="font-family:times new roman;width:100%">
        		<option value=""></option>
        		<%
        			sSQL="Select * from PHAN_LOAI_QD"
				Set Rec=server.CreateObject("ADODB.Recordset")
				Rec.CursorType=3
				Rec.CacheSize=5
				Rec.Open sSQL,Conn
				Do While not Rec.EOF
			%>
				<option value=<%=Rec("IDLoai")%>>	<%=Rec("TEN_HINH_THUC")%></option>
			<%
					Rec.movenext
				Loop
				Rec.close
				Set Rec=nothing
			%>	
        	</select>
        </td>
      </tr>
      <tr>
        <td width="15%" >&nbsp;Người ký</td>
        <td width="30%" colspan=2>
        <input name=TxtNguoiky style="font-family:times new roman;width:100%" size="20"></td>        
        <td width="15%" align=center>Từ khoá</td>
        <td width="40%" colspan=3>
        <input name=TxtTukhoa style="font-family:times new roman;width:100%" size="20"></td>  
      </tr>
      <tr>
        <td width="15%"></td>
        <td width="15%"></td>
        <td width="15%"></td>
        <td width="15%"></td>
        <td width="15%"></td>
        <td width="15%"></td>
        <td width="10%"></td>
      </tr>
  </table>
</FIELDSET>
			</td>
		</tr>
	</table>
</form>
<script>
		var btn;	
		btn = document.getElementById("btnSearch"); createButton(btn);	btn.setEnabled(true);
		btn = document.getElementById("btnCancel"); createButton(btn);	btn.setEnabled(true);
</script>
</body>
<Script language=javascript>
	function KT(){
		if(trim(Noidung.TxtTungay.value)!=""){
			if(!isDate(Noidung.TxtTungay.value)){
				alert("Ngay khong hop le !");
				Noidung.TxtTungay.focus();
				return false;
			}
		}
		if(trim(Noidung.TxtDenngay.value)!=""){
			if(!isDate(Noidung.TxtDenngay.value)){
				alert("Ngay khong hop le !");
				Noidung.TxtDenngay.focus();
				return false;
			}
		}
		if(trim(Noidung.TxtNam.value)!="" && Noidung.TxtNam.disabled==false){
			if(!IsNumeric(Noidung.TxtNam.value)){
				alert("Nam khong hop le !");
				Noidung.TxtNam.focus();
				return false;
			}
		}
		if(trim(Noidung.TxtSoden.value)!="") {
			if(!IsNumeric(Noidung.TxtSoden.value)){
				alert("So den khong hop le !");
				Noidung.TxtSoden.focus();
				return false;
			}
		}
		if(trim(Noidung.TxtDenso.value)!="") {
			if(!IsNumeric(Noidung.TxtDenso.value)){
				alert("So den khong hop le !");
				Noidung.TxtDenso.focus();
				return false;
			}
		}
		return true;
	}
	function OK(){
		if(KT()){
			Noidung.target="right";
			if(Noidung.CHK.checked){
//HienSX
				Noidung.action="<%=Session("tenvtqd")%>?bComm=search&VT=VTQD&bLoai=1&sort="+Noidung.Sort.value;
			}
			else{
				Noidung.action="<%=Session("tenvtqd")%>?bComm=search&VT=VTQD&bLoai=0&sort="+Noidung.Sort.value;
			}
			Noidung.submit();
			window.close();
		}
	}
	function Cmd(){
		if (Noidung.CHK.checked){
			//Noidung.TxtSoden.disabled=true;
			//Noidung.TxtDenso.disabled=true;
			Noidung.TxtNam.disabled=true;
			Noidung.TxtTungay.disabled=false;
			Noidung.TxtDenngay.disabled=false;
			/*
			Noidung.TxtSKH.disabled=false;
			Noidung.TxtTrichyeu.disabled=false;
			Noidung.TxtND.disabled=false;
			Noidung.ComboLoaiVB.disabled=false;
			Noidung.TxtNguoiky.disabled=false;
			Noidung.TxtTukhoa.disabled=false;
			//Change Color
			Noidung.TxtSoden.style.background="#C0C0C0";
			Noidung.TxtDenso.style.background="#C0C0C0";
			*/
			Noidung.TxtNam.style.background="#C0C0C0";
			Noidung.TxtTungay.style.background="#FFFFFF";
			Noidung.TxtDenngay.style.background="#FFFFFF";
			/*
			Noidung.TxtSKH.style.background="#FFFFFF";
			Noidung.TxtTrichyeu.style.background="#FFFFFF";
			Noidung.TxtND.style.background="#FFFFFF";
			Noidung.ComboLoaiVB.style.background="#FFFFFF";
			Noidung.TxtNguoiky.style.background="#FFFFFF";
			Noidung.TxtTukhoa.style.background="#FFFFFF";
			*/
			Noidung.TxtTungay.focus();
		}
		else{
			Noidung.TxtSoden.disabled=false;
			Noidung.TxtDenso.disabled=false;
			Noidung.TxtNam.disabled=false;
			Noidung.TxtTungay.disabled=true;
			Noidung.TxtDenngay.disabled=true;
			/*
			Noidung.TxtSKH.disabled=true;
			Noidung.TxtTrichyeu.disabled=true
			Noidung.TxtND.disabled=true;
			Noidung.ComboLoaiVB.disabled=false;
			Noidung.TxtNguoiky.disabled=true;
			Noidung.TxtTukhoa.diabled=true;
			*/
			Noidung.TxtNam.value="<%=year(Date())%>";
			//Change Color
			//Noidung.TxtSoden.style.background="#FFFFFF";
			//Noidung.TxtDenso.style.background="#FFFFFF";
			Noidung.TxtNam.style.background="#FFFFFF";
			Noidung.TxtTungay.style.background="#C0C0C0";
			Noidung.TxtDenngay.style.background="#C0C0C0";
			/*
			Noidung.TxtSKH.style.background="#C0C0C0";
			Noidung.TxtTrichyeu.style.background="#C0C0C0";
			Noidung.TxtND.style.background="#C0C0C0";
			Noidung.ComboLoaiVB.style.background="#FFFFFF";
			Noidung.TxtNguoiky.style.background="#C0C0C0";
			Noidung.TxtTukhoa.style.background="#C0C0C0";
			*/
			Noidung.TxtSoden.focus();			
		}
		
	}
function TxtTungay_onkeyup(str){
var keycode
keycode=window.event.keyCode
if (isEdit(keycode,str)){
	Noidung.TxtTungay.value=editdate(trim(str))
}
	Noidung.TxtDenngay.value=Noidung.TxtTungay.value
}

function TxtDenngay_onkeyup(str){
var keycode
keycode=window.event.keyCode
if (isEdit(keycode,str)){
	Noidung.TxtDenngay.value=editdate(trim(str))
}
}

function TxtSoden_onkeyup(str){
	Noidung.TxtDenso.value=Noidung.TxtSoden.value
}

</script>
</html>